Skip to content

ci: skip CI jobs when unaffected by changed paths#1380

Merged
mishushakov merged 9 commits into
mainfrom
mishushakov/conditional-ci-jobs
Jun 15, 2026
Merged

ci: skip CI jobs when unaffected by changed paths#1380
mishushakov merged 9 commits into
mainfrom
mishushakov/conditional-ci-jobs

Conversation

@mishushakov

Copy link
Copy Markdown
Member

Adds a dorny/paths-filter change-detection job to the PR-triggered workflows so jobs only run when relevant paths change: Lint/Typecheck run only when package code, spec, or lint configs change; Generated files runs only when codegen inputs/outputs change; and the JS/Python/CLI SDK tests run only when the respective SDK changes (CLI also runs on JS SDK changes since it builds against it). The SDK test jobs are gated inside the reusable workflows via a new run input rather than by skipping the caller, so the required matrix status checks still report (skipped jobs report success) and branch protection stays satisfied. Shared paths (spec, lockfiles, package.json, .tool-versions) and workflow_dispatch runs still trigger everything.

🤖 Generated with Claude Code

Add a dorny/paths-filter "changes" detection job to the PR-triggered
workflows so jobs only run when relevant paths change:

- Lint / Typecheck: only when package code, spec, or lint configs change
- Generated files: only when codegen inputs/outputs change
- JS / Python / CLI SDK tests: only when the respective SDK changes
  (CLI also runs when the JS SDK changes, since it builds against it)

The SDK test jobs are gated inside the reusable workflows via a new
`run` input so the required matrix status checks still report (skipped
jobs report success), keeping branch protection satisfied.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed label Jun 2, 2026
@cursor

cursor Bot commented Jun 2, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Wrong path filters could skip tests that should run; the run-input skip pattern assumes GitHub treats skipped matrix jobs as passing required checks.

Overview
PR workflows now use dorny/paths-filter so lint, typecheck, generated-files, and SDK test orchestration only run when matching paths change. Reusable JS, Python, and CLI test workflows take a run input and gate the matrix with if inputs.run so callers still invoke the workflow and required checks can succeed when tests are skipped. sdk_tests.yml maps js, python, and cli filters (CLI includes js-sdk), runs the filter step only on pull_request, and forces a full run on workflow_dispatch.

Reviewed by Cursor Bugbot for commit 7655d17. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Jun 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7655d17

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from 38f1d83. Download artifacts from this workflow run.

JS SDK (e2b@2.30.1-mishushakov-conditional-ci-jobs.0):

npm install ./e2b-2.30.1-mishushakov-conditional-ci-jobs.0.tgz

CLI (@e2b/cli@2.11.2-mishushakov-conditional-ci-jobs.0):

npm install ./e2b-cli-2.11.2-mishushakov-conditional-ci-jobs.0.tgz

Python SDK (e2b==2.29.0+mishushakov-conditional-ci-jobs):

pip install ./e2b-2.29.0+mishushakov.conditional.ci.jobs-py3-none-any.whl

Comment thread .github/workflows/sdk_tests.yml
mishushakov and others added 2 commits June 2, 2026 15:36
dorny/paths-filter falls back to git commands on non-PR events, which
fails without a checkout. Guard the filter step to pull_request only; the
run inputs already force a full run on workflow_dispatch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mishushakov mishushakov marked this pull request as ready for review June 2, 2026 14:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68854cbb35

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/generated_files.yml Outdated
Comment thread .github/workflows/sdk_tests.yml
Comment thread .github/workflows/generated_files.yml Outdated
mishushakov and others added 2 commits June 2, 2026 18:22
Enumerating individual generated outputs was fragile and missed the
Python volume/mcp codegen targets. Generated files are interleaved with
hand-written code inside the SDK source trees, so watch the whole trees
to catch drift without maintaining a per-file allowlist.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Simpler and fully robust: any package change re-verifies generated code
is in sync, with no per-path allowlist to maintain.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread .github/workflows/generated_files.yml
The codegen toolchain versions are pinned via the lockfile/package.json
and .tool-versions, so a dependency-only PR can change generated output.
Watch the same shared paths as the lint/typecheck/sdk-tests filters.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mishushakov mishushakov enabled auto-merge (squash) June 4, 2026 13:59

@matthewlouisbrockman matthewlouisbrockman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like it! if we start seeing weird issues from missing issues on loosely related code can revisit but hopefully makes faster

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7655d17. Configure here.

Comment thread .github/workflows/js_sdk_tests.yml
@mishushakov mishushakov merged commit 1d6c45c into main Jun 15, 2026
29 checks passed
@mishushakov mishushakov deleted the mishushakov/conditional-ci-jobs branch June 15, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants